home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Controls / Visual Basic Controls.iso / vbcontrol / ioport / ioport.txt < prev    next >
Encoding:
Text File  |  1998-08-19  |  12.5 KB  |  351 lines

  1.   
  2.  
  3.  
  4.  
  5.  
  6.  
  7.                     UPPER CANADA TECHNOLOGIES
  8.  
  9.  
  10.   IOPORT OCX version 1.1    Copyright (c) 1998,   Robert Woudsma 
  11.                    All Rights Reserved
  12.  
  13.  
  14.  
  15.  
  16. Why would I use IOPORT?
  17.  
  18. In DOS based variations of the BASIC programming language programmers
  19. could easily access the IBM-compatible computers I/O ports with the
  20. INP and OUT commands. For many programmers Visual Basic has become 
  21. programming language of choice to develop Windows based applications.
  22. As robust and simple as Visual Basic is to use, it does not contain
  23. the commands to access the computers I/O ports. IOPORT is a custom 
  24. control that can be easily added to any Visual Basic project to
  25. provide 8-bit or 16-bit READ and WRITE capability to any port within
  26. the PCs I/O address space.  IOPORT is a 32-bit ActiveX /OCX control
  27. designed to be used with Visual Basic 4.0 or 5.0 under Windows 95. It
  28. will not operate properly under Windows NT.
  29.  
  30. Shareware Notice
  31.  
  32. The IOPORT is distributed under shareware principle. As such, you are
  33. welcome to use it for a trial period of up to 30 days.  If you find
  34. that IOPORT is useful to you and you wish to continue using it then
  35. please register this product and support software being produced under
  36. the shareware concept.  You may freely copy/distribute the shareware
  37. version in it's original form as long as you make no changes to any
  38. of the IOPORT files and you charge no fee for it beyond reproduction 
  39. costs.  If you register IOPORT, then you may use it in your own
  40. personal software or in commercial products with no royalty fee.
  41.  
  42. IOPORT.OCX Installation & Registration
  43.  
  44. 1.     If you downloaded IOPORT from the Internet copy the IOPORT.ZIP
  45.      file to a temporary directory on your hard drive and unzip it.
  46.      If you received IOPORT on a distribution diskette, then the 
  47.     files are not zipped and you can copy them directly from the 
  48.     diskette.
  49.  
  50. 2.     Copy the file IOPORT.OCX to your Windows\System or     
  51.     Win95\System directory. If the     program "regsvr32.exe" is not
  52.      in the System directory then copy this file also from the
  53.      temporary directory or diskette to the System directory.
  54.  
  55. 3.     Next, you must register IOPORT with Windows 95.  To do this,
  56.      select the Start button and then choose Run. Type:
  57.  
  58.         regsvr32 ioport.ocx
  59.                      ....to register the IOPORT 
  60.     OCX. A dialog box will appear indicating whether or not the
  61.      registration was successful. 
  62.  
  63. 4.     If you copied IOPORT.OCX to a different directory than the
  64.      Windows\System     directory you must include the full path when 
  65.     registering the control. For example, if you copied IOPORT.OCX
  66.      to the directory C:\program files\vb5\CONTROLS then you must
  67.      type the following command to register the control:  
  68.  
  69.          regsvr32  c:\program files\vb5\controls\ioport.ocx
  70.  
  71.     The "regsvr32.exe" program must still exist or be placed in 
  72.     the Windows\System or Win95\System directory.
  73.  
  74. 5.     A number of .DLL files must be present in the Windows\System 
  75.     or Win95\System directory to be called when registering and 
  76.     using the IOPORT OCX. These files may or may not already exist
  77.      in the directory. The files include: 
  78.  
  79.         mfc42.dll,
  80.           msvcrt40.dll
  81.         olepro32.dll
  82.  
  83.      If the IOPORT OCX fails to become successfully registered 
  84.     using the methods outlined in sections 3 and 4 above. Download
  85.      the ZIP file sprtdlls.zip from the UCT Web site    or copy the
  86.      ZIP file from the distribution diskette. Unzip this file to
  87.      the Windows\System or Win95\System directory. Use the 
  88.     regsvr32.exe program as outlined in section 3 above to register
  89.     OLEPRO32.dll and MFC42.dll and repeat the registration process 
  90.     for IOPORT.OCX.
  91.  
  92. Adding IOPORT to your Visual Basic Project    
  93.  
  94. 1. Visual Basic 4.0
  95.  
  96. Once the IOPORT OCX has been registered with Windows 95, adding it to
  97. the Visual Basic controls toolbox is simple. From the Visual Basic
  98. main menu select [Tools]. From the Tools drop-down menu select [Custom
  99. Controls]. This will display the Custom Controls dialog box which 
  100. lists the controls that can be added to the Visual Basic toolbox.
  101. Select [ioport ActiveX Control module] from the list and click on 
  102. [OK]. The dialog box will disappear. You should now see a new control
  103. icon, shown as the letters "I/O" with a blue double-pointed arrow 
  104. beneath them, in the controls toolbox.
  105.  
  106.  
  107. 2. Visual Basic 5.0
  108.  
  109. Accessing the IOPORT control is a bit different in Visual Basic 5.0. 
  110. Instead of selecting [Tools] from the main menu, select [Project].
  111. From the Project drop-down menu select [Components]. A similar 
  112. Components dialog box will appear.
  113.  
  114. On the Controls page of the dialog box select the [ioport ActiveX
  115. Control module] and click on [OK]. The control icon, as described 
  116. above should now be displayed in the toolbox.
  117.  
  118. To place the IOPORT control on a form follow the procedure for most 
  119. Visual Basic controls; click on the control icon in the toolbox and
  120. then use the mouse to drag a rectangle on the form. When the rectangle
  121. is drawn, the control will be displayed as a green icon with the
  122. letters "I/O" and a red double-pointed arrow beneath them. The 
  123. properties of the IOPORT control are now available to your Visual
  124. Basic code. 
  125.  
  126. NOTE: The control is visible only at design time on your Visual Basic 
  127. form. It will disappear from the form when the Visual Basic program is
  128.  executed.
  129.  
  130.  
  131.  
  132. Using IOPORT in Visual Basic
  133.  
  134. 1)    "IOTEST" Sample Application
  135.     There are two Visual Basic projects included in the IOPORT.ZIP
  136.      file or on the     distribution disk; one called IOTEST5 for use
  137.      with Visual Basic 5.0 and another called IOTEST4 for use with
  138.     Visual Basic 4.0. 
  139.  
  140.     The test application files include the form, project and 
  141.     executable files. By viewing and running these files you can 
  142.     get a understanding of how the IOPORT OCX can be used in your 
  143.     own Visual Basic applications.   
  144.  
  145. 2)     IOPORT Properties
  146.     The NAME property of the IOPORT.OCX control is IOPORT. When 
  147.     the control is first placed on a Visual Basic form it's 
  148.     default NAME property will be set to IOPORT1, following the 
  149.     control naming convention of Visual Basic. If a second IOPORT 
  150.     control is placed on the form it's NAME property would be set
  151.      to IOPORT2. These names can be changed in the IOPORT property
  152.      window but this should be done before any code is written 
  153.     using the IOPORT's properties.
  154.  
  155.     Besides the general properties of almost all Visual Basic 
  156.     controls such as NAME,     TOP, LEFT, ABOUT, INDEX etc. there are
  157.      four unique properties in the IOPORT control;     "address",
  158.      "bitsize", "USValue" and "value".  A description of each 
  159.     control property and how it is used follows.
  160.  
  161. - Address    This property sets the address of the I/O port that 
  162.         the programmer wishes to read from or write to. The 
  163.         value can be an integer number from 0 to 65536.
  164.  
  165. - Bitsize    This property defines whether the value to be written 
  166.         or read will be a byte (8-bits) or a word (16-bits).
  167.          The only valid values for this property is 8 or 16, 
  168.         any other values will result in no change of the 
  169.  
  170.         property.
  171.  
  172. - Value        1) 8-bit operation: (bitsize = 8)
  173.         During a write operation the value contained in the
  174.          value property will be delivered to the I/O port 
  175.         defined by the address property. Valid write values 
  176.         are from 0 to 255.
  177.         During a read operation the value of the contents of 
  178.         the I/O port defined by the address property will be 
  179.         returned to the value property. Values returned will
  180.          be from 0 to 255.
  181.  
  182.         2) 16-bit operation:  (bitsize = 16)
  183.         In 16-bit operation the value property operates the 
  184.         same as in 8-bit mode. The only difference is that in
  185.          16-bit mode the values written or read are considered
  186.          to be signed 16-bit words. As such valid write and 
  187.         returned values range from -32768 to +32767.
  188.  
  189. - USValue      16-bit mode only: (bitsize = 16)
  190.         This property operates in the same way as the value
  191.          property, above but uses unsigned 16-bit values and is
  192.          only valid in 16-bit mode. When in 16-bit mode it may
  193.          be desired by programmers that the 16-bit value being
  194.          written or returned be of the unsigned integer format
  195.          where valid values range from 0 to 65536. 
  196.  
  197.  
  198. IOPORT Software Registration
  199.  
  200. Registration of the IOPORT control with Upper Canada Technologies 
  201. grants you a single user license. As such, you may install IOPORT on 
  202. as many computers as you wish provided that only the registered person
  203. uses it and that no two copies of IOPORT will be in use at the same 
  204. time. You are required to purchase one copy of IOPORT for each person
  205. that will use it. 
  206. As a registered user you may include IOPORT OCX in any software that 
  207. you develop and distribute so long as IOPORT is only a component of 
  208. your software and does not constitute your software's major function.
  209.  
  210.  
  211. To register, please fill out the registration form on the last page of
  212.  this document and mail it, along with your payment, to:
  213.  
  214.         Robert Woudsma
  215.         UPPER CANADA TECHNOLOGIES
  216.         R.R. #1, 2699 Lakefield Dr.
  217.         Inverary, Ontario
  218.         K0H 1X0
  219.         E-mail: rjw@uct.on.ca
  220.  
  221. Registered users receive free updates to the current version (ie 1.x 
  222. to 1.y).  Major revision upgrades (ie 1.x to 2.x) will only cost $5.00.
  223.  
  224. Constructive comments/criticism are always welcome at the above 
  225. snail-mail or E-mail address. 
  226.  
  227.  
  228.  
  229.  
  230. IOPORT Pricing:
  231.  
  232.        Copies            Price (includes Taxes)
  233.     1  to  9          $15.00 each
  234.     10 to 19    $13.50 each 
  235.         20 to 29    $12.00 each
  236.     30 to 50    $10.50 each
  237.     50+        $ 8.50 each
  238.  
  239. Site License arrangements are available on a per unit cost basis.
  240. Please E-mail at the above address for Site License pricing.  
  241.     
  242. Educational Prices
  243. As an educator, I have a soft spot for accredited educational 
  244. institutions, all of which seem to be undergoing fiscal restraint.
  245. Special pricing is in place for educational facilities on unit or site
  246. license basis. Please E-mail for details.
  247.  
  248.  
  249. Files Listing
  250.  
  251.  
  252. The IOPORT distribution diskette and/or IOPORT.ZIP file should contain
  253. the following files:
  254.  
  255. IOPORT.OCX        the ActiveX control file
  256. REGSVR32.EXE        Windows registration file for OCX controls
  257. IOPORT7.DOC        MS-WORD 7.0/Office 97 documentation file
  258. IOPORT.TXT        DOS text documentation file
  259.  
  260. Visual Basic 4.0 IOTEST files:
  261. IOTEST4.EXE        Executable IOTEST program
  262. IOTEST4.FRM        Visual Basic form file
  263. IOTEST4.VBP        Visual Basic project file
  264. IOTEST4.VBW        Visual Basic Workspace file
  265.  
  266. Visual Basic 5.0 IOTEST files:
  267. IOTEST5.EXE        Executable IOTEST program
  268. IOTEST5.FRM        Visual Basic form file
  269. IOTEST5.VBP        Visual Basic project file
  270. IOTEST5.VBW        Visual Basic Workspace file
  271.  
  272.  
  273. In addition, the distribution diskette contains the SPRTDLLS.ZIP file
  274. which contains the support .DLL type files required in the 
  275. Windows\System or Win95\System directory to register and operate
  276. various OCX-type files including IOPORT.OCX.
  277. This .ZIP file can also be downloaded from the UPPER CANADA 
  278. TECHNOLOGIES web site at:
  279.  
  280.  
  281.             www.uct.on.ca
  282.  
  283.  
  284.  
  285.  
  286.  
  287.  
  288. IOPORT Registration Form
  289.  
  290. Please fill out the following form and mail with your payment to:
  291.  
  292. UPPER CANADA TECHNOLOGIES
  293. R.R.#1, 2699 Lakefield Dr.
  294. Inverary, Ontario Canada
  295. K0H 1X0
  296.  
  297. Name:         ______________________________
  298.  
  299. Company:    ______________________________
  300.  
  301. Address:    ______________________________
  302.  
  303.         ______________________________
  304.                                
  305. E-Mail:        ______________________________
  306.  
  307.                 Number of copies:________
  308. Copies     Price 
  309. 1  to 9   $15 each           Price per copy:  ________
  310. 10 to 19  $13.50 each
  311. 20 to 29  $12.00 each          Total price:      ________
  312. 30 to 50  $10.50 each
  313. 50+      $ 8.50 each         Amount enclosed: ________
  314.  
  315.  
  316. How did you hear about IOPORT?________________________________________
  317.  
  318. Where did you get IOPORT?_____________________________________________
  319.  
  320. What will you use IOPORT for?_________________________________________
  321.  
  322. ______________________________________________________________________
  323.  
  324. Features you would like to see added:_________________________________
  325.  
  326. ______________________________________________________________________
  327.  
  328. ______________________________________________________________________
  329.  
  330. Comments:_____________________________________________________________
  331.  
  332. ______________________________________________________________________
  333.  
  334. ______________________________________________________________________
  335.  
  336.  
  337. ***********Thank You for purchasing IOPORT.OCX !**********************
  338.  
  339.       Copyright(c) 1998 Robert Woudsma,  UPPER CANADA TECHNOLOGIES
  340.  
  341.  
  342.  
  343. IOPORT Revision History
  344.  
  345. Version    Date        Description
  346.  
  347. 1.0        02/98        IOPORT.OCX  first released
  348.  
  349. 1.1    08/98    Fixed bug in 8-bit data read section. Would read 8-bit data as 0 through 127, then -128 through -1.
  350.  
  351.